package com.ten.stat.controller;

import com.ten.common.core.vo.Result;
import com.ten.stat.service.EduCourseService;
import com.ten.stat.vo.EduCourseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ：王薪伟
 * @date ：Created in 2022/12/13 17:43
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("/stat/course")
@Api(tags = "课程销量接口类")
public class EduCourseController {

    @Autowired
    private EduCourseService courseService;

    @ApiOperation(value = "统计课程销售额")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "课程名称",name = "title")
    })
    @PostMapping("queryAllCourseRanking")
    public Result<List<EduCourseVo>> queryAllCourseRanking() {
        return courseService.findCount();
    }
}
